﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Omu.Awesome.Mvc;

namespace Omu.AwesomeDemo.Infra.Dto
{
    public class AjaxCheckBoxListDemoInput
    {
        [Required]
        [UIHint("AjaxCheckBoxList")]
        public IEnumerable<int> Hobbies { get; set; }

        [UIHint("AjaxCheckBoxList")]
        public IEnumerable<int> Shows { get; set; }

        [UIHint("AjaxCheckBoxList")]
        [AjaxCheckBoxList(ParentId = "Shows")]
        public IEnumerable<int> Characters { get; set; }
    }

    public class AjaxRadioListDemoInput
    {
        [UIHint("AjaxRadioList")]
        public int? Hobby { get; set; }

        [UIHint("AjaxRadioList")]
        public int? Show { get; set; }

        [Required]
        [UIHint("AjaxRadioList")]
        [AjaxRadioList(ParentId = "Show")]
        public int? Character { get; set; }

        [UIHint("AjaxRadioList")]
        [AjaxRadioList(ParentId = "Character")]
        public int? PersonHobby { get; set; }
    }

    public class AjaxDropdownDemoInput
    {
        [Required]
        public int? Country { get; set; }

        [UIHint("AjaxDropdown")]
        [Required]
        public int? Hobby { get; set; }
        
        [UIHint("AjaxDropdown")]
        [DisplayName("this uses Guid as a key")]
        [AjaxDropdown(Controller = "HobbyGuidAjaxDropdown")]
        public Guid? HobbyGuid { get; set; }

        public int? Show { get; set; }

        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "PersonAjaxDropdown",  ParentId = "Show")]
        public int? Character { get; set; }

        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "CharsAjaxDropdown")]
        [AwesomeParameters("{code:'Friends'}")]
        public int? CharsFriends { get; set; }        
        
        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "CharsAjaxDropdown")]
        [AwesomeParameters("{code:'South Park'}")]
        public int? CharsSouthPark { get; set; }
    }
}